﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Laoyang.Web.Controllers
{
    public class LoginController : Controller
    {
        public IActionResult Index()
        {
            return View();
        }

        public ActionResult Login(string username,string password)
        {
            if (username=="a"&&password=="123")
            {

                HttpContext.Session.SetString("username", username);
                return Content("登录成功！");
            }
            else if (username=="b"&&password=="123")
            {
                HttpContext.Session.SetString("username", username);
                return Content("登录成功！");
            }
            else
            {
                return Content("登录失败！");
            }
        }
    }
}